package org.ccu.eshop.test;

import com.alibaba.fastjson.JSON;
import org.ccu.eshop.domain.dto.CategoryVO;

import java.util.ArrayList;
import java.util.List;

public class Q {
    public static void main(String[] args) {
        List<CategoryVO> categoryList=new ArrayList<CategoryVO>();
        CategoryVO vo=new CategoryVO();
        vo.setId(1);
        vo.setCateName("计算机类");
        vo.setCateDesc("计算机类的书籍");
        CategoryVO vo2=new CategoryVO();
        vo2.setId(2);
        vo2.setCateName("音乐类");
        vo2.setCateDesc("音乐类的书籍");
        CategoryVO vo3=new CategoryVO();
        vo3.setId(3);
        vo3.setCateName("美术类");
        vo3.setCateDesc("美术类的书籍");
        categoryList.add(vo);
        categoryList.add(vo2);
        categoryList.add(vo3);
        String data= JSON.toJSONString(categoryList);
        System.out.println(data);
    }
}
